package com.iweb.controller;

import com.iweb.common.result.ResultEntity;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("swagger")
public class SwaggerController {

    // 接口说明
    @ApiOperation("测试swagger")
    // 这个可以不写
    @ApiImplicitParam(name = "username", value = "传入测试参数", required = true, dataType = "String", dataTypeClass =
            String.class)
    @GetMapping("{username}")
    public ResultEntity<String> swagger(@PathVariable String username) {
        return ResultEntity.SUCCESS(String.format("hello %s", username));
    }

}
